<%@ page language="java" pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
<title>用户追踪统计系统</title>
 <%@ include file="/WEB-INF/view/commons/meta.jsp"%>
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0, user-scalable=no">


<link rel="shortcut icon" type="image/x-icon" href="${ctx}/resources/images/favicon.ico" />
</head>

<body style="background:#2a7daf url(${ctx}/resources/images/login_bg.png) repeat-x;">
<!--登录头部-->
<div class="login_top"><img src="${ctx}/resources/images/logo.png" ></div>

<!--登录内容-->
<div class="logins">

<!--内容左边-->
<div class="l_left"><img src="${ctx}/resources/images/l-left.png" ></div>

<!--内容右边-->
<div class="l_right">
<h1 style="margin-left: 50px;">用户访问追踪后台</h1>
<ul>
<form action="${ctx}/system/login" method="post" id="loginForm" onsubmit="return validateLogin();">
<div  id="showMessage" style="color: red; position:absolute; left:90px; top:105px;  ">${errorMessage}</div>
<li><span style="float: left;color: #ffffff;margin: 20 0 0 0;line-height: 40px;">用户名：</span><input  type="text" name="userName"  class="l_input" id="userName">
<%-- <c:choose>
	<c:when test="${errorMessage==null}"><span class="Silent" style="display: none"></span></c:when>
	<c:otherwise><span class="Silent">${errorMessage}</span></c:otherwise>
</c:choose> --%>
</li>
<li><span class="loginSpan">密 &nbsp;&nbsp;码：</span><input  name="passWord" type="password"  class="l_input" id="password"></li>

<li><span class="loginSpan">验证码：</span>
<input  name="authCode" type="text"  class="l_input" id="authCode" style="width: 129px;" maxlength="4">
<span style="margin-left: 5px;"> 

	<a href="javascript:void(0);" onclick="createAuthCode();">
							<img id="checkNumImage" src="${ctx}/system/getAuthCode.ac" width="85" height="40">
							</a>
</span>
</li>
<li style="margin-left: 50px;"><input  type="submit" class="dl_an" text="" ></li>
</form
</ul>
</div>

</div>


<!--登录底部-->
<div class="l_bottom"> 深圳市盖威科技有限公司</div>

<script type="text/javascript">
	// 提交请求
	function validateLogin(){
		// 帐号
		var account = $("#userName");
		var accountVal = $.trim(account.val());
		// 密码
		var password = $("#password");
		var passwordVal = $.trim(password.val());
		var authCode=$("#authCode");
		var authCodeVal = $.trim(authCode.val());
		
		if(accountVal == "" || accountVal == null){
			$("#showMessage").html("用户名不能为空");
			return false;
		}
		
		if(passwordVal == "" || passwordVal == null){
			$("#showMessage").html("密码不能为空");
			return false;
		}
		if(authCodeVal == "" || authCodeVal == null){
			$("#showMessage").html("验证码不能为空");
			return false;
		}
		if(!!isNaN(authCodeVal)){
			$("#showMessage").html("验证码为数字");
			return false;
		}
		
	}
	// 从新获取验证码
	function createAuthCode(){
		$("#checkNumImage").attr("src","${ctx}/system/getAuthCode.ac?"+Math.random());
	}
</script>

</body>
</html>
